package com.example.szh.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.example.szh.R;
import com.example.szh.adapter.VideoNewsVpAdapter;
import com.flyco.tablayout.SlidingTabLayout;


public class VideoFragment extends Fragment {


    private SlidingTabLayout peopleTab;
    private ViewPager peopleVp;
    private View inflate;
    private VideoNewsVpAdapter adapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        inflate = inflater.inflate(R.layout.fragment_video, container, false);
        initView();
        return inflate;
    }

    private void initView() {
        peopleTab = inflate.findViewById(R.id.people_tab);
        peopleVp = inflate. findViewById(R.id.video_vp);
        adapter=new VideoNewsVpAdapter(getFragmentManager());
        peopleVp.setAdapter(adapter);
        peopleTab.setViewPager(peopleVp);
    }
}